import { setStorage, getStorage } from '@/utils/tools'
const state = () => ({
  demo: false,
  HeaderTable: getStorage('HeaderTable'), //TOP数据
  budgetSheetNum: getStorage('budgetSheetNum'),
})
const getters = {
  demo: (state) => state.demo,
  HeaderTable: (state) => state.HeaderTable,
  budgetSheetNum: (state) => state.budgetSheetNum, //预算单号
}
const mutations = {
  setDemo(state, demo) {
    state.demo = demo
  },
  setHeaderTable(state, Headertable) {
    state.HeaderTable = Headertable
    setStorage('HeaderTable', Headertable)
  },
  setBudgetSheetNum(state, budgetSheetNum) {
    state.budgetSheetNum = budgetSheetNum
    setStorage('budgetSheetNum', budgetSheetNum)
  },
}
const actions = {
  setDemo({ commit }, demo) {
    commit('setDemo', demo)
  },
  setHeaderTable({ commit }, admin) {
    commit('setHeaderTable', admin)
  },
  setBudgetSheetNum({ commit }, admin) {
    commit('setBudgetSheetNum', admin)
  },
}
export default { state, getters, mutations, actions }
